package com.longma.server.constant.enums;

/**
 * @Author: zy
 * @Description: 告警通知类型
 * @Date: 2020/2/19
 */
public enum NotifyTypeEnum  implements IBaseEnum<Integer> {
    //控制设备
    CONTROLL(0,"控制设备"),

    //微信通知
    WETCHAT(1,"微信通知"),

    //微信通知
    SMS(2,"短信通知"),

    //微信通知
    EMAIL(3,"邮件通知");

    /**
     * 值
     */
    private int value;

    /*
     * 描述信息
     */
    private String desc;

    /**
     * 构造函数
     */
    NotifyTypeEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    /**
     * 通过值转为枚举类型
     */
    public static NotifyTypeEnum fromValue(int value) {
        switch (value) {
            case 0:
                return CONTROLL;
            case 1:
                return WETCHAT;
            case 2:
                return SMS;
            case 3:
                return EMAIL;
            default:
                throw new IllegalArgumentException();
        }
    }

    /**
     * 获取值
     */
    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String getDesc() {
        return  this.desc;
    }

}
